import Vue from 'vue';
import axios from 'axios';

export default new Vue ({
  data () {
    return {
      data: [],
    };
  },
  created () {
    this.$on('search', async () => {
      const res = await axios({
        method: 'get',
        url: 'https://www.escook.cn/api/cart',
      });
      this.data = res.data.list;
    });
  },
});
